Homework 3 : due by 5 : 00 pm on Friday , March 13 , 2015 ( Total : 100 points ) Instructor :
نویسنده
چکیده
All homeworks should be submitted in a directory named hw 3 using svn or turnin as before. In case of problems, you should email a zip file containing the directory to [email protected] before the deadline. See course wiki for slip day policy and late submission penalties. IMPORTANT: The programming assignment in this homework is more challenging than in past homeworks. It is critical that you start early on the programming assignment to meet the deadline. Honor Code Policy: All submitted homeworks are expected to be the result of your individual effort. You are free to discuss course material and approaches to problems with your other classmates, the teaching assistants and the professor, but you should never misrepresent someone elses work as your own. If you use any material from external sources, you must provide proper attribution. Please submit your solutions to the written assignments in either a plain text file named hw 3 written.txt or a PDF file named hw 3 written.pdf in the hw 3 directory. 1.1 Future Tasks and Data-Driven Futures 1. (10 points) Summarize the similarities and differences between futures and data-driven futures in HJ-lib. In your summary, you should state if it is possible to create a race condition or a deadlock when accessing the value in the future container when using either construct. 2. (15 points) Consider the HJ-lib code fragment below that operates on an array of DataDrivenFutures. (Note that there are no get() operations in this example, so the only purpose of the put() operation is to synchronize with await clauses. For simplicity, we just use an empty string "" as the object being put into a DataDrivenFuture.) Is it possible for any instance of the async statement in line 6 to be indefinitely blocked on its await clause? If so, explain how. If not, explain why not.
منابع مشابه
Homework 5 : due by 11 : 55 pm on Friday , April 12 , 2013 ( Total : 100 points ) Instructor : Vivek Sarkar
2. (10 points) Is a livelock possible in Solution 2 (using Java’s lock library) for this variant with 4 philosophers attempting to first acquire the left fork, and then the right fork, and the fifth philosopher doing the opposite? If so, show an execution that exhibits a livelock. If not, explain why not. For the purpose of this program, a livelock is a scenario in which all philosophers starve...
متن کاملHomework 3 : due by 12 noon on Friday , March 18 , 2016 Instructor : Vivek Sarkar , Co - Instructor : Shams Imam
The slip day policy for COMP 322 is similar to that of COMP 321. All students will be given 3 slip days to use throughout the semester. When you use a slip day, you will receive up to 24 additional hours to complete the assignment. You may use these slip days in any way you see fit (3 days on one assignment, 1 day each on 3 assignments, etc.). If you use slip days, you must submit a README.txt ...
متن کاملHomework 3 : due by 11 : 59 pm on Wednesday , March 22 , 2017 Instructor : Vivek Sarkar , Co - Instructor : Mackale Joyner . Programming Checkpoint
Your solution to the written assignment should be submitted as a PDF file named hw 3 written.pdf in the hw 3 directory. This is important — you will be penalized 10 points if you place the file in some other folder or with some other name. The PDF file can be created however you choose. If you scan handwritten text, make sure that you use a proper scanner (not a digital camera) to create the PD...
متن کاملHomework 3 : due by 11 : 59 pm on Wednesday , March 22 , 2017 Instructor : Vivek Sarkar , Co - Instructor : Shams Imam . Programming Checkpoint
Your solution to the written assignment should be submitted as a PDF file named hw 3 written.pdf in the hw 3 directory. This is important — you will be penalized 10 points if you place the file in some other folder or with some other name. The PDF file can be created however you choose. If you scan handwritten text, make sure that you use a proper scanner (not a digital camera) to create the PD...
متن کاملHomework 2 : due by 11 : 59 pm on Tuesday , September 25 , 2012 ( Total : 100 points ) Instructor : Vivek Sarkar Co - Instructor : Ran Libeskind - Hadas
2. In class we developed the Shearsort Algorithm which sorts n numbers on a mesh in time O( √ n log n). Now we’ll develop an asymptotically optimal sorting algorithm for a √ n× √ n mesh. That is, we’ll find an algorithm that runs in time O( √ n). We’ll call this algorithm “Niftysort”. The Niftysort algorithm will sort the input into a snakelike order (just like the ordering that Shearsort gave ...
متن کامل